<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('_checkThumbImg'))
{
    function _checkThumbImg($img)
    {
        $sizeImg = getimagesize($img);
        if(is_array($sizeImg)){
            $pos = strrpos($img,"/");
            $thumbSrc = substr($img,0,$pos)."/mcith/mcith_".substr($img,$pos+1);
            $sizeThumb = getimagesize($thumbSrc);
            if(is_array($sizeThumb)){
                return $thumbSrc;
            }
        }
        return $img;
    }
}
if ( ! function_exists('_showAds'))
{
    function _showAds($url, $link="", $title=""){
        if(strrchr($url, ".") == ".swf"){
            $str = '
                    <a href="'.$link.'" target="_blank" title="'.$title.'" ref="nofollow">
                	   <embed src="'.$url.'"></embed>
                    </a>
                   ';
                        
        }else{
            $str = '
                	<a href="'.$link.'" target="_blank" title="'.$title.'" ref="nofollow">
                    	<img src="'.$url.'" alt="'.$title.'"/>
                    </a>
                   ';
        }
        return $str;
    } 
}